<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title></title>
    <link rel="stylesheet" href="/bootstrap-3.3.7/dist/css/bootstrap.css">
    <link rel='stylesheet' href='/stylesheets/style.css' />
    <script src="/javascripts/jquery.min.js"></script>
    <script src='/bootstrap-3.3.7/dist/js/bootstrap.min.js'></script>
  </head>
  <body>
  <div class="container-fluid">
    <div class="row">
      <div class="col-md-12 mynav">
        <nav class="navbar navbar-default">
          <div class="container">
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header">
              <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
              </button>
              <a class="navbar-brand" href="/">主页</a>
            </div>

            <!-- Collect the nav links, forms, and other content for toggling -->
            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
              <ul class="nav navbar-nav">
              <!-- <li><a href="/">新鲜事</span></a></li> -->
              <!-- <li><a href="#">问答</a></li> -->
              <li><a href="/yangsheng">养生</a></li>
              <li><a href="/meishi">美食</a></li>
              <li><a href="/hufu">护肤</a></li>
                <!-- <li class="dropdown">
                  <a href="#" class="dropdo
                  wn-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">我的圈子 <span class="caret"></span></a>
                  <ul class="dropdown-menu">
                    <li><a href="#">佛系排行榜</a></li>
                    <li><a href="#">佛系笔记</a></li>
                    <li><a href="#">佛系活动</a></li>
                  </ul>
                </li> -->
              </ul>
              <ul class="nav navbar-nav navbar-right">
               <% if(typeof(username)=='undefined') { %>
                    <li><a class="sm_a" href="/login">登录</a></li>
                    <li><a class="sm_a" href="#">注册</a></li>
                  <% } %>
                  <% if(typeof(username)!='undefined') { %>
                    <% if(username!='') { %>
                      <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><%= username %> <span class="caret"></span></a>
                        <ul class="dropdown-menu">
                          <li><a href="/myHome">我的主页</a></li>
                          <li><a href="/write">写博客</a></li>
                          <li><a href="/setting">资料设置</a></li>
                          <li role="separator" class="divider"></li>
                          <li><a href="/exit">退出登录</a></li>
                        </ul>
                      </li>
                    <% } %>
                    <% if(username=='') { %>
                      <li><a class="sm_a" href="/login">登录</a></li>
                      <li><a class="sm_a" href="#">注册</a></li>
                    <% } %>
                   <% } %>

              </ul>
              <form class="navbar-form navbar-right">
                <div class="form-group">
                  <input type="text" class="form-control" placeholder="Search">
                </div>
                <i class="glyphicon glyphicon-search mysearch"></i>
              </form>
            </div><!-- /.navbar-collapse -->
          </div><!-- /.container-fluid -->
        </nav>
      </div>
    </div>
  </div>
  <br>
  
  <!-- <section id="lunbo"> -->
  <% if (typeof(images)!='undefined'){ %>
    <div class="container mylunbo">
       <div id="carousel-example-generic" class="carousel slide myslide" data-ride="carousel">
        <!-- Indicators -->
        <ol class="carousel-indicators">
          <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
          <li data-target="#carousel-example-generic" data-slide-to="1"></li>
          <li data-target="#carousel-example-generic" data-slide-to="2"></li>
        </ol>

        <!-- Wrapper for slides -->
        <div class="carousel-inner" role="listbox">
          <div class="item active">
            <img src="<%= images[0] %>" alt="...">
            <div class="carousel-caption">
              <p><%= des[0] %></p>
            </div>
          </div>
          <div class="item">
            <img src="<%= images[1] %>" alt="...">
            <div class="carousel-caption">
              <p><%= des[1] %></p>
            </div>
          </div>
          <div class="item">
            <img src="<%= images[2] %>" alt="...">
            <div class="carousel-caption">
              <p><%= des[2] %></p>
            </div>
          </div>
        </div>

        <!-- Controls -->
        <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
          <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
          <span class="sr-only">Previous</span>
        </a>
        <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
          <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
          <span class="sr-only">Next</span>
        </a>
      </div>
    </div>
  <% } %>
 
   
  <!-- </section> -->
  <br>
  <div class="container">
    <div class="row">
      <div class="col-md-12">
         <% for (var i=0; i<data.length; i++) { %>
      
          <div class="item">
            <figure class="img-responsive">
              <img class="" src="<%=data[i].pic %>" alt="">
            </figure>   
            <aside>
                <h3><a href="/article?title=<%=data[i].title %>&author=<%= data[i].author%>"><%=data[i].title %></a></h3>
                <p class="ar_con"><%=data[i].content %></p>
                <div class="disc">
                  <span class="type"><%=data[i].type %></span>
                  <div class="item_right">
                    <span><%=data[i].author %></span>
                    <time><%=data[i].date %></time>
                  </div>
                  
                </div>
                
            </aside>  
          </div>      
        <% } %>
      </div>
    </div>
  </div>
   
    <div class="container">
      <div class="row">
        <div class="col-md-12 text-center">
          <nav aria-label="Page navigation">
            <ul class="pagination">
              <li>
                <a href=/?page=pre aria-label="Previous">
                  <span aria-hidden="true">&laquo;</span>
                </a>
              </li>
              <% for (var i=1; i<=sumPage; i++) { %>
                <li><a href="/?page=<%=i%>"><%= i%></a></li>
              <% } %>
              <li>
                <a href="/?page=next" aria-label="Next">
                  <span aria-hidden="true">&raquo;</span>
                </a>
              </li>
            </ul>
          </nav>
        </div>
      </div>
    </div>


  </body>
</html>